//
//  QMAStartUpProtocolImp.m
//  QQMiniGameSDKDemo
//
//  Created by Goyoungs on 2023/4/14.
//

#import "QMAStartUpProtocolImp.h"
OBJC_EXTERN NSString *const DemoErrorTipSwitch;
@implementation QMAStartUpProtocolImp


/// 小游戏启动失败回调
/// - Parameters:
///   - error: 启动失败Error信息
///   - app: 小游戏信息
///   - parentVC: 启动接口对应的vc
- (void)handleStartUpError:(NSError *_Nonnull)error
                       app:(MABaseApplication *_Nullable)app
                  parentVC:(UIViewController *_Nonnull)parentVC {
    //TODO: 宿主可做监控
    NSLog(@"startup appid=%@ error=%@ code=%lld", app.appInfo.appID, error.localizedDescription,(long long)error.code);
}

/// 小游戏启动成功
/// - Parameter app: 小游戏信息
- (void)handleStartUpSuccessWithApp:(MABaseApplication *_Nonnull)app {
    NSLog(@"startup success");
}

/// 是否开启错误提示，默认不开启，失败信息提示
- (BOOL)enableErrorAlert {
    //错误提醒，release需要关闭
//    NSNumber *tipSwitch = [[NSUserDefaults standardUserDefaults] objectForKey:DemoErrorTipSwitch];
//    if(tipSwitch && [tipSwitch isKindOfClass:[NSNumber class]]) {
//        return [tipSwitch boolValue];
//    }
    
    return NO;
}

@end
